home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Graphics / WildFire / WildFireNoFPU / Bonus / draggadget_r0.8 / drag.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-17  |  3.7 KB  |  123 lines

  1. #ifndef GADGETS_DRAG_H
  2. #define GADGETS_DRAG_H TRUE
  3.  
  4. /*
  5. **  $VER: drag.h 0.11 (17.6.1997)
  6. **
  7. **  Definitions for BOOPSI drag gadget objects
  8. **
  9. **  (c) Copyright 1996/97 Joerg Kollmann
  10. **  All Rights Reserved
  11. **
  12. */
  13.  
  14. #ifndef EXEC_TYPES_H
  15. #include <exec/types.h>
  16. #endif
  17.  
  18. #ifndef EXEC_LIBRARIES_H
  19. #include <exec/libraries.h>
  20. #endif
  21.  
  22. #ifndef INTUITION_CLASSES_H
  23. #include <intuition/classes.h>
  24. #endif
  25.  
  26. #ifndef INTUITION_INTUITION_H
  27. #include <intuition/intuition.h>
  28. #endif
  29.  
  30. #ifndef UTILITY_TAGITEM_H
  31. #include <utility/tagitem.h>
  32. #endif
  33.  
  34. #ifndef IFF_IFFPARSE_H
  35. #include <libraries/iffparse.h>
  36. #endif
  37.  
  38. /*********************************************************************/
  39.  
  40. struct DragInfo
  41. {
  42.   WORD            type;       /* DGT_xxx */
  43.   Object          *object;    /* target object */
  44.   struct {
  45.     WORD          X;          /* rel. to RastPort of gadget */
  46.     WORD          Y;
  47.   } mouse;
  48.   struct {
  49.     WORD          X;          /* mouse offset rel.to gadget */
  50.     WORD          Y;
  51.   } offset;
  52.   UWORD           id;         /* gadget->GadgetID of dropped gadget */
  53.   APTR            userdata;   /* gadget->UserData of dropped gadget */
  54.   struct DragInfo *next;      /* DragInfo of next selected (dropped) gadget.
  55.                                  not implemented */
  56. };
  57.  
  58. /* type of DragInfo object */
  59. #define DGT_NoObject 0
  60. #define DGT_Gadget   1
  61. #define DGT_Window   2
  62.  
  63. struct DropMessage {
  64.   struct Message dm_Message;
  65.   UWORD dm_Type;
  66.   ULONG dm_UserData;
  67.   ULONG dm_ID;
  68.   struct DragInfo *dm_DragInfo;
  69. };
  70.  
  71. /* type of drop message */
  72. #define DMTYPE_OWN          0
  73. #define DMTYPE_DROPWINDOW   7
  74.  
  75. /*********************************************************************/
  76.  
  77. #define DGA_Dummy   (TAG_USER+0x05000000)
  78.  
  79. #define DGA_ExtSelect   (DGA_Dummy+1)  /* BOOL, default FALSE, Applicability: (I)
  80.         * with this attribute set to TRUE, the gadget image stays selected
  81.         * after dropping. To deselect it set (GA_Selected,FALSE) */
  82.  
  83. #define DGA_Context     (DGA_Dummy+2)  /* Context of object, Applicability: (I).
  84.         * result of CreateDContext(screen). Replaces DGA_Screen. */
  85. #define DGA_Screen      (DGA_Dummy+3)  /* Screen/Window of drag object, mutually */
  86. #define DGA_Window      (DGA_Dummy+4)  /* exclusive. Applicability: (I)
  87.         * DGA_Screen should be replaced by DGA_Context. It may only be
  88.         * used with non-public screens. */
  89.  
  90. #define DGA_DragInfo    (DGA_Dummy+5)  /* (struct DragInfo*), Applicability: (G)
  91.         * gadget->SpecialInfo also points to this struct. */
  92.  
  93. #define DGA_Frame       (DGA_Dummy+6)  /* Object (Image), Applicability: (I) */
  94.                                        /* not implemented */
  95. #define DGA_DragImage   (DGA_Dummy+7)  /* Image for Bob, Applicability: (IS) */
  96.  
  97. #define DGA_DragAnim    (DGA_Dummy+8)  /* NULL-terminated array of Image*
  98.                                           not implemented */
  99. #define DGA_NodropImage (DGA_Dummy+9)  /* not implemented */
  100.  
  101. #define DGA_DragGroup   (DGA_Dummy+10) /* DragGroup, Applicability: (IS)
  102.         * makes this gadget part of a group. NULL removes it from the group.
  103.         * If the group gadgets are DGA_ExtSelect, they deselect each other,
  104.         * or if selected with SHIFT pressed, can be dragged as a group.
  105.         * not implemented */
  106.  
  107. #define DGA_DropActHook (DGA_Dummy+11) /* (struct Hook*), Applicability: (I)
  108.         * if a drag gadget is dropped an this gadget, the hook is called with
  109.         * Object=this Gadget and Message=DragInfo of the dropped gadget */
  110.  
  111. /*********************************************************************/
  112.  
  113. #define OM_DROPACTION   MAKE_ID('O','M','D','A')
  114.  
  115. struct opDropAction
  116. {
  117.   ULONG              MethodID;
  118.   struct GadgetInfo *opda_GInfo;
  119.   struct DragInfo   *opda_DragInfo;
  120. };
  121.  
  122. #endif /* GADGETS_DRAG_H */
  123.